package com.dingreading.cloud.soms.api;

import com.dingreading.cloud.soms.dto.CaTeacherDto;
import com.dingreading.cloud.soms.service.CaTeacherService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/teacher")
public class TeacherApiController {

    @Resource
    private CaTeacherService teacherService;

    @ApiOperation(value = "根据课表uid获取导读")
    @GetMapping(value = "/getTeachersByScheduleUids", produces = "application/json; charset=UTF-8")
    public List<CaTeacherDto> getTeachersByScheduleUids(
            @ApiParam(value = "课表uid集合") @RequestParam(value = "scheduledUids") List<String> scheduledUids
    ) throws Exception {

        List<CaTeacherDto> list = teacherService.getTeachersByScheduleUids(null, scheduledUids, 1);
        return list;
    }

}
